package org.abettor.pushbox.map;
/**
 * 用来记录每步走的步骤
 * @author jzh
 *
 */
public class Step {
	public static final int UP=0,DOWN=1,LEFT=2,RIGHT=3;
	private byte status;//低四位用来保存各个值,高四位用来保存是否推动了箱子,正数为推动了,负数为没有
	public Step(int status,boolean isPushBox){
		if(isPushBox)
			this.status = (byte) status;
		else
			this.status = (byte) (status | 0xf0);
	}
	public Step(byte status){
		this.status = status;
	}
	/**
	 * 把step格式化为字符叔祖
	 * @return
	 */
	public byte toByte(){
		return this.status;
	}
	public int getStatus(){
		return this.status & 0xf;
	}
	//是否推动了箱子
	public boolean isPushBox(){
		if(status >= 0){
			return true;
		}else{
			return false;
		}
	}
}
